<template>
    <div>
      <h1>学生姓名：{{name}}</h1> 
      <h1>年龄：{{age}}</h1>
      <button @click="sendStudentName">点击我 我传值到school</button>
    </div>
</template>

<script>
    export default {
        data() {
            return {
               name:'小伙',
               age:18,
            }
        },
        methods: {
           sendStudentName() {
                this.$bus.$emit('aaaaa',this.name)
                console.log(this.name);
            }
        },
    }
</script>

<style lang="scss" scoped>

</style>